export default{
    changeXy (state,  {x , y, viewHeight, seaHeight }){
        state.x = x
        state.y = y
        state.viewHeight = viewHeight
        state.seaHeight = seaHeight
    },
    changeCityName(state, headerCity){
        state.headerCity = headerCity
        try {
           localStorage.headerCity = headerCity
          } catch (e) {}
    },
    changeCountyName(state,countyName){
        state.headerCounty = countyName
        try {
            localStorage.headerCounty = countyName
          } catch (e) {}
    },
    changeStationName(state, stationName){
        state.headerStation = stationName
        try {
            localStorage.headerStation = stationName
          } catch (e) {}
    },
    changeStationX(state,stationX){ 
        state.stationX = stationX
    },
    changeStationY(state,stationY){
        state.stationY = stationY
    },
    changeCityX(state,cityX){
        state.cityX = cityX
    },
    changeCityY(state,cityY){
        state.cityY = cityY
    },
    changeCountyX(state,countyX){
        state.countyX = countyX
    },
    changeCountyY(state,countyY){
        state.countyY = countyY
    },
    changeChart(state, chart){
        state.chart = chart
    },
    changeN(state,changeN){
        state.changeN = changeN
    },
    changeForq(state,forq){
        state.forq = forq
    },
    changeFYLZCS(state,fylzCS){
        state.fylzCS = fylzCS
    },
    getFYLZC(state,fylzc){
        state.fylzc = fylzc
    },
    getFYLZAll(state,fylzall){
        state.fylzall = fylzall
    },
    changeFYLZCOUNTRY(state,fylzcountry){
        state.fylzcountry=fylzcountry
    },
    changeFYLZCOUNTRYALL(state,fylzcountryall){
        state.fylzcountryall=fylzcountryall
    },
    getFYLZCounts(state,FYLZCounts){
        try{
            if(localStorage.FYLZCounts){
                FYLZCounts = localStorage.FYLZCounts
            }else{
                state.FYLZCounts = FYLZCounts
            }
        } catch (e) {}
    },
    getTOP10FYLZCounts(state,TOP10FYLZCounts){
        state.TOP10FYLZCounts = TOP10FYLZCounts
    },
    getCountryStationQXDJCounts(state,CountryStationQXDJCounts){
        state.CountryStationQXDJCounts = CountryStationQXDJCounts
    },
    getStationQXDJCounts(state,StationQXDJCounts){
        state.StationQXDJCounts = StationQXDJCounts
    },
    changeState(state,curState){
        state.curState = curState
    },
    changeqxll(state,qxll){
        state.qxll = qxll
    },
    getobjPopup(state,objPopup){
        state.objPopup = objPopup
    },
    getobjPopup1(state,objPopup1){
        state.objPopup1 = objPopup1
    },
    getobjPopup2(state,objPopup2){
        state.objPopup2 = objPopup2
    },
    getobjPopup3(state,objPopup3){
        state.objPopup3 = objPopup3
    },
    getobjPopup1(state,objPopup4){
        state.objPopup4 = objPopup4
    },
    getobjPopup1(state,objPopup7){
        state.objPopup7 = objPopup7
    },
    getDate(state){
        setInterval(function(){
            let date = new Date()
            let hour = date.getHours()
            let minute = date.getMinutes()
            let second = date.getSeconds()
            let month = date.getMonth() + 1
            let today = date.getDate()
            state.time = timeToString(hour) + ":" + timeToString(minute) + ":" + timeToString(second)
            state.year = date.getFullYear() + "-" + timeToString(month) + "-" +  timeToString(today)
            let weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]
            state.week = weekday[date.getDay()]
            function timeToString(nowTime){
                if(nowTime<10){
                    return "0" + nowTime;
                }else{
                    return ''+ nowTime;
            }
        }
    } ,1000)
        
    },
    //
    setMarkerArr1(state,markerArr1){
        state.markerArr1 = markerArr1
    },
    setMarkerArr2(state,markerArr2){
        state.markerArr2 = markerArr2
    },
    changeCities(state,cities){
        state.cities = cities
    },
    changeCounty(state,county){
        state.county = county
    },
    changeStation(state,station){
        state.station = station
    },
    changeAllStationsModel(state,model){
        state.model = model
    }
}